
#ifndef _MEMBER_BScrollArea_H_
#define _MEMBER_BScrollArea_H_

#include <BRect>
#include <BScrollBar>
#include <BScrollArea>

#define area_member(scrollArea)	((member_BScrollArea*)((BScrollBar*)scrollArea)->_ptr)

namespace BWE
{
	class BWidget;
	class BScrollBar;

	class member_BScrollArea : public BObject
	{
		friend class BScrollArea;
	public:
		member_BScrollArea(BScrollArea* scrollArea);
		~member_BScrollArea();

		bool applyAreaPolicy();
		void adjustScrollBar();

		void slotMouseLeaveVerticalScrollBar();
		void slotVerticalScrollStepChanged(BObject* object, const BValue& value);
		void slotVerticalScrollValueChanged(BObject* object, const BValue& value);

		void slotMouseLeaveHorizontalScrollBar();
		void slotHorizontalScrollStepChanged(BObject* object, const BValue& value);
		void slotHorizontalScrollValueChanged(BObject* object, const BValue& value);

		BScrollArea*		boss;
		Align				areaAlign;
		BMargin			areaMargin;
		BRect				rawArea;
		BRect				area;
		int					vstep;
		int					hstep;
		BSize				handleSize;
		BSizePolicy			areaPolicy;
		ScrollPolicy		hScrollPolicy;
		BHolder<BScrollBar>	hScrollBar;
		ScrollPolicy		vScrollPolicy;
		BHolder<BScrollBar>	vScrollBar;
		bool				dirty;
	};
}

#endif